{$CLEO .cs}
0000:
 
model.Load(#VMAFF2)
model.Load(#VMAFF3)
model.Load(#VMAFF1) 
model.Load(#VMAFF4) 
           
model.Load(#ak47)
model.Load(#SNIPER)
model.Load(#CUNTGUN)
model.Load(#SILENCED)
model.Load(#TEC9)
model.Load(#DESERT_EAGLE)
model.Load(#MP5LNG)
model.Load(#M4)
model.Load(#CHROMEGUN)
model.Load(#SAWNOFF)
model.Load(#COLT45)
model.Load(#MICRO_UZI)
model.Load(#SHOTGSPA)
038B: load_requested_models
04ED: load_animation  "gangs"


24@ = 20.0 
25@ = 20.0 
26@ = 20.0 
const 
    ICON = 28@ 
   GANG_WAR_OPPERATED   = 29@ 
   GANG_WAR_SECRET_LOCATION = 30@ 
   GANG_WAR_KILLED  = 31@
end
GANG_WAR_OPPERATED = false 
//GANG_WAR_KILLED = false 
//GANG_WAR_SECRET_LOCATION = false 
 
while $onmission >= 1
wait 0 
if   $GANG_NOTORIETY >= 1 
then
24@ = 30.0 
25@ = 30.0 
26@ = 20.0 
else 
24@ = 15.0 
25@ = 15.0                                         
26@ = 10.0 
end
   if  and 
   not  marker_enabled  ICON
   GANG_WAR_SECRET_LOCATION == true  
   then
       ICON = marker.CreateIconWithoutSphere(19 , -1827.6593, 1301.0554, 59.7327)
       
   end
if and 
 GANG_WAR_KILLED == false 
 00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere  -1827.6593 1301.0554 59.7327 radius 100.0 100.0 100.0       //where it is
then
   //load them up 
   if   and 
   model.Available(  #VMAFF1)
   model.Available(  #VMAFF2)
   model.Available(  #VMAFF3)   
   model.Available(  #VMAFF4)   
   then
       if and 
       not is_actor_defined 1@ 
       not is_actor_defined 2@ 
       not is_actor_defined 3@ 
       not is_actor_defined 4@ 
       not is_actor_defined 5@ 
       not is_actor_defined 6@ 
       not is_actor_defined 7@ 
       not is_actor_defined 8@ 
       then
           1@ = actor.Create(  gang1 , #VMAFF1 , -1827.6593, 1301.0554, 59.7327)
           04C4: store_coords_to 21@ 22@ 23@  from_actor 1@ with_offset 0.0 3.0 -1.0
           2@ = actor.Create(  gang1 , #VMAFF2 , 21@, 22@, 23@   )
           04C4: store_coords_to 21@ 22@ 23@  from_actor 1@ with_offset 0.0 2.0 -1.0
           3@ = actor.Create(  gang1 , #VMAFF3 , 21@, 22@, 23@  )
           04C4: store_coords_to 21@ 22@ 23@  from_actor 1@ with_offset 0.0 -2.0 -1.0
           4@ = actor.Create(  gang1 , #VMAFF4 , 21@, 22@, 23@  )
           04C4: store_coords_to 21@ 22@ 23@  from_actor 1@ with_offset 0.0 -3.0 -1.0
           5@ = actor.Create(  gang1 , #VMAFF1 , 21@, 22@, 23@  )
           04C4: store_coords_to 21@ 22@ 23@  from_actor 1@ with_offset 2.0 3.0 -1.0
           6@ = actor.Create(  gang1 , #VMAFF2 , 21@, 22@, 23@  )
           04C4: store_coords_to 21@ 22@ 23@  from_actor 1@ with_offset -2.0 3.0 -1.0
           7@ = actor.Create(  gang1 , #VMAFF3 , 21@, 22@, 23@  )
           04C4: store_coords_to 21@ 22@ 23@  from_actor 1@ with_offset 2.0 -2.0 -1.0
           8@ = actor.Create(  gang1 , #VMAFF4 , 21@, 22@, 23@  )
           actor.Angle(1@) = 90.0
           actor.Angle(2@) = 34.0
           actor.Angle(3@) = 15.0
           actor.Angle(4@) =  0.0
           actor.Angle(5@) =  270.0
           actor.Angle(6@) =  142.0
           actor.Angle(7@) =  121.0
           actor.Angle(8@) =  45.0
           actor.GiveWeaponAndAmmo(1@, m4 , 999999)
           actor.GiveWeaponAndAmmo(2@, m4 , 999999)
           actor.GiveWeaponAndAmmo(3@, microuzi , 999999)
           actor.GiveWeaponAndAmmo(4@, microuzi  , 999999)
           actor.GiveWeaponAndAmmo(5@, microuzi , 999999)
           actor.GiveWeaponAndAmmo(6@, sawnoff  , 999999)
           actor.GiveWeaponAndAmmo(7@, CombatShotgun , 999999)
           actor.GiveWeaponAndAmmo(8@, CombatShotgun , 999999)
           actor.WeaponAccuracy(1@)=45
           actor.WeaponAccuracy(2@)=45
           actor.WeaponAccuracy(3@)=45
           actor.WeaponAccuracy(4@)=45
           actor.WeaponAccuracy(5@)=45
           actor.WeaponAccuracy(6@)=45
           actor.WeaponAccuracy(7@)=45
           actor.WeaponAccuracy(8@)=45
           081A: set_actor 1@ weapon_skill_to 2
           081A: set_actor 2@ weapon_skill_to 2
           081A: set_actor 3@ weapon_skill_to 2
           081A: set_actor 4@ weapon_skill_to 2
           081A: set_actor 5@ weapon_skill_to 2
           081A: set_actor 6@ weapon_skill_to 2
           081A: set_actor 7@ weapon_skill_to 2
           081A: set_actor 8@ weapon_skill_to 2

           07DD: set_actor 1@ attack_rate 75 // previously known as temper_to
           07DD: set_actor 2@ attack_rate 75 // previously known as temper_to
           07DD: set_actor 3@ attack_rate 75 // previously known as temper_to
           07DD: set_actor 4@ attack_rate 75 // previously known as temper_to
           07DD: set_actor 5@ attack_rate 75 // previously known as temper_to
           07DD: set_actor 6@ attack_rate 75 // previously known as temper_to
           07DD: set_actor 7@ attack_rate 75 // previously known as temper_to
           07DD: set_actor 8@ attack_rate 75 // previously known as temper_to
           actor.Health(1@)=400
           actor.Health(2@)=400
           actor.Health(3@)=400
           actor.Health(4@)=400
           actor.Health(5@)=400
           actor.Health(6@)=400
           actor.Health(7@)=400
           actor.Health(8@)=400 
           0605: actor 1@  perform_animation "prtial_gngtlkA" IFP "gangs" framedelta 4.0 loop 1 lockX 0 lockY 0 lockF 0 time -1
           0605: actor 2@  perform_animation "smkcig_prtl" IFP "gangs" framedelta 4.0 loop 1 lockX 0 lockY 0 lockF 0 time -1
           0605: actor 3@  perform_animation "smkcig_prtl"  IFP "gangs" framedelta 4.0 loop 1 lockX 0 lockY 0 lockF 0 time -1
           0605: actor 4@  perform_animation "prtial_gngtlkf" IFP "gangs" framedelta 4.0 loop 1 lockX 0 lockY 0 lockF 0 time -1
           0605: actor 5@  perform_animation "prtial_gngtlke" IFP "gangs" framedelta 4.0 loop 1 lockX 0 lockY 0 lockF 0 time -1
           0605: actor 6@  perform_animation "prtial_gngtlkh" IFP "gangs" framedelta 4.0 loop 1 lockX 0 lockY 0 lockF 0 time -1
           0605: actor 7@  perform_animation "smkcig_prtl" IFP "gangs" framedelta 4.0 loop 1 lockX 0 lockY 0 lockF 0 time -1
           0605: actor 8@  perform_animation "smkcig_prtl" IFP "gangs" framedelta 4.0 loop 1 lockX 0 lockY 0 lockF 0 time -1
                                           //smkcig_prtl
           wait 100                                
          end
       end
   else  
       if and
        is_actor_defined 1@ 
        is_actor_defined 2@ 
        is_actor_defined 3@ 
        is_actor_defined 4@ 
        is_actor_defined 5@ 
        is_actor_defined 6@ 
        is_actor_defined 7@ 
        is_actor_defined 8@    
       then 
               actor.RemoveReferences( 1@ )
               actor.RemoveReferences( 2@ )
               actor.RemoveReferences( 3@ )
               actor.RemoveReferences( 4@ )
               actor.RemoveReferences( 5@ )
               actor.RemoveReferences( 6@ )
               actor.RemoveReferences( 7@ )
               actor.RemoveReferences( 8@ ) 
               GANG_WAR_OPPERATED = false  //this goes off again
               wait 100
       end        
end 

//start gang war 
if and
is_actor_defined 1@ 
is_actor_defined 2@ 
is_actor_defined 3@ 
is_actor_defined 4@ 
is_actor_defined 5@ 
is_actor_defined 6@ 
is_actor_defined 7@ 
is_actor_defined 8@    
then 
   if and
   GANG_WAR_KILLED == false 
   GANG_WAR_OPPERATED == false 
   then
       if  or 
        0104:   actor $PLAYER_ACTOR near_actor 1@ radius 24@ 25@ 26@ sphere 0
        0104:   actor $PLAYER_ACTOR near_actor 2@ radius 24@ 25@ 26@ sphere 0
        0104:   actor $PLAYER_ACTOR near_actor 3@ radius 24@ 25@ 26@ sphere 0
        0104:   actor $PLAYER_ACTOR near_actor 4@ radius 24@ 25@ 26@ sphere 0
        0104:   actor $PLAYER_ACTOR near_actor 5@ radius 24@ 25@ 26@ sphere 0
        0104:   actor $PLAYER_ACTOR near_actor 6@ radius 24@ 25@ 26@ sphere 0
        0104:   actor $PLAYER_ACTOR near_actor 7@ radius 24@ 25@ 26@ sphere 0
        0104:   actor $PLAYER_ACTOR near_actor 8@ radius 24@ 25@ 26@ sphere 0

       then
      // 0792: disembark_instantly_actor $PLAYER_ACTOR
          077A: set_actor 1@ acquaintance 4 to_actors_pedtype 0 // see ped.dat
          077A: set_actor 2@ acquaintance 4 to_actors_pedtype 0 // see ped.dat
          077A: set_actor 3@ acquaintance 4 to_actors_pedtype 0 // see ped.dat
          077A: set_actor 4@ acquaintance 4 to_actors_pedtype 0 // see ped.dat
          077A: set_actor 5@ acquaintance 4 to_actors_pedtype 0 // see ped.dat
          077A: set_actor 6@ acquaintance 4 to_actors_pedtype 0 // see ped.dat
          077A: set_actor 7@ acquaintance 4 to_actors_pedtype 0 // see ped.dat
          077A: set_actor 8@ acquaintance 4 to_actors_pedtype 0 // see ped.dat 

          077A: set_actor 1@ acquaintance 4 to_actors_pedtype 1 // see ped.dat
          077A: set_actor 2@ acquaintance 4 to_actors_pedtype 1 // see ped.dat
          077A: set_actor 3@ acquaintance 4 to_actors_pedtype 1 // see ped.dat
          077A: set_actor 4@ acquaintance 4 to_actors_pedtype 1 // see ped.dat
          077A: set_actor 5@ acquaintance 4 to_actors_pedtype 1 // see ped.dat
          077A: set_actor 6@ acquaintance 4 to_actors_pedtype 1 // see ped.dat
          077A: set_actor 7@ acquaintance 4 to_actors_pedtype 1 // see ped.dat
          077A: set_actor 8@ acquaintance 4 to_actors_pedtype 1 // see ped.dat 
        0792: disembark_instantly_actor 1@
        0792: disembark_instantly_actor 2@
        0792: disembark_instantly_actor 3@
        0792: disembark_instantly_actor 4@
        0792: disembark_instantly_actor 5@
        0792: disembark_instantly_actor 6@
        0792: disembark_instantly_actor 7@
        0792: disembark_instantly_actor 8@ 
          actor_kill_victim  1@  $PLAYER_ACTOR
          actor_kill_victim  2@  $PLAYER_ACTOR
          actor_kill_victim  3@  $PLAYER_ACTOR
          actor_kill_victim  4@  $PLAYER_ACTOR
          actor_kill_victim  5@  $PLAYER_ACTOR
          actor_kill_victim  6@  $PLAYER_ACTOR
          actor_kill_victim  7@  $PLAYER_ACTOR
          actor_kill_victim  8@  $PLAYER_ACTOR
          GANG_WAR_OPPERATED = true
          GANG_WAR_SECRET_LOCATION = true 
          if $GANG_NOTORIETY <= 0
          then
          $GANG_NOTORIETY += 1 
          end
          show_styled_text "~y~Gang Operation Discovered" 3000 5
          018C: play_sound 1053 at 0.0 0.0 0.0

       end
       if coop 
       then
               if  or 
                0104:   actor player2 near_actor 1@ radius 24@ 25@ 26@ sphere 0
                0104:   actor player2 near_actor 2@ radius 24@ 25@ 26@ sphere 0
                0104:   actor player2 near_actor 3@ radius 24@ 25@ 26@ sphere 0
                0104:   actor player2 near_actor 4@ radius 24@ 25@ 26@ sphere 0
                0104:   actor player2 near_actor 5@ radius 24@ 25@ 26@ sphere 0
                0104:   actor player2 near_actor 6@ radius 24@ 25@ 26@ sphere 0
                0104:   actor player2 near_actor 7@ radius 24@ 25@ 26@ sphere 0
                0104:   actor player2 near_actor 8@ radius 24@ 25@ 26@ sphere 0
               then               
                0792: disembark_instantly_actor 1@
                0792: disembark_instantly_actor 2@
                0792: disembark_instantly_actor 3@
                0792: disembark_instantly_actor 4@
                0792: disembark_instantly_actor 5@
                0792: disembark_instantly_actor 6@
                0792: disembark_instantly_actor 7@
                0792: disembark_instantly_actor 8@                
                   GANG_WAR_OPPERATED = true
                   GANG_WAR_SECRET_LOCATION = true 
                      actor_kill_victim  1@  player2
                      actor_kill_victim  2@  player2
                      actor_kill_victim  3@  player2
                      actor_kill_victim  4@  player2
                      actor_kill_victim  5@  player2
                      actor_kill_victim  6@  player2
                      actor_kill_victim  7@  player2
                      actor_kill_victim  8@  player2     
                      077A: set_actor 1@ acquaintance 4 to_actors_pedtype 0 // see ped.dat
                      077A: set_actor 2@ acquaintance 4 to_actors_pedtype 0 // see ped.dat
                      077A: set_actor 3@ acquaintance 4 to_actors_pedtype 0 // see ped.dat
                      077A: set_actor 4@ acquaintance 4 to_actors_pedtype 0 // see ped.dat
                      077A: set_actor 5@ acquaintance 4 to_actors_pedtype 0 // see ped.dat
                      077A: set_actor 6@ acquaintance 4 to_actors_pedtype 0 // see ped.dat
                      077A: set_actor 7@ acquaintance 4 to_actors_pedtype 0 // see ped.dat
                      077A: set_actor 8@ acquaintance 4 to_actors_pedtype 0 // see ped.dat 
            
                      077A: set_actor 1@ acquaintance 4 to_actors_pedtype 1 // see ped.dat
                      077A: set_actor 2@ acquaintance 4 to_actors_pedtype 1 // see ped.dat
                      077A: set_actor 3@ acquaintance 4 to_actors_pedtype 1 // see ped.dat
                      077A: set_actor 4@ acquaintance 4 to_actors_pedtype 1 // see ped.dat
                      077A: set_actor 5@ acquaintance 4 to_actors_pedtype 1 // see ped.dat
                      077A: set_actor 6@ acquaintance 4 to_actors_pedtype 1 // see ped.dat
                      077A: set_actor 7@ acquaintance 4 to_actors_pedtype 1 // see ped.dat
                      077A: set_actor 8@ acquaintance 4 to_actors_pedtype 1 // see ped.dat                       
                      show_styled_text "~y~Gang Operation Discovered" 3000 5
                      018C: play_sound 1053 at 0.0 0.0 0.0        
                      if $GANG_NOTORIETY <= 0
                      then
                      $GANG_NOTORIETY += 1 
                      end                                                                      
               end           
       
       end 
    end 
    
    
    
end 
   

   if  and 
    marker_enabled   ICON
    GANG_WAR_KILLED == true 
   then
   
       marker.Disable(ICON)
   end 
   //Kill all of them
   if GANG_WAR_KILLED == false 
   then 
       if and
        is_actor_defined 1@ 
        is_actor_defined 2@ 
        is_actor_defined 3@ 
        is_actor_defined 4@ 
        is_actor_defined 5@ 
        is_actor_defined 6@ 
        is_actor_defined 7@ 
        is_actor_defined 8@    
       then
           if and
           actor.Dead( 1@ )
           actor.Dead( 2@ )
           actor.Dead( 3@ )
           actor.Dead( 4@ )
           actor.Dead( 5@ )
           actor.Dead( 6@ )
           actor.Dead( 7@ )
           actor.Dead( 8@ )
           then
               $GANG_OPERATION_COMPLETED  += 1   
               GANG_WAR_KILLED = true 
               show_styled_text "~r~Gang Operation Destroyed ~w~$5000" 3000 5
               018C: play_sound 1052 at 0.0 0.0 0.0
               0109: player $PLAYER_CHAR money += 5000 
               actor.RemoveReferences( 1@ )
               actor.RemoveReferences( 2@ )
               actor.RemoveReferences( 3@ )
               actor.RemoveReferences( 4@ )
               actor.RemoveReferences( 5@ )
               actor.RemoveReferences( 6@ )
               actor.RemoveReferences( 7@ )
               actor.RemoveReferences( 8@ ) 
           end
       
       end
   end   
   if GANG_WAR_KILLED == true
   then
      break
   end
end

//cleanup
   if 
   marker_enabled  ICON 
   then
      marker.Disable( ICON)
       
   end
   if and
    is_actor_defined 1@ 
    is_actor_defined 2@ 
    is_actor_defined 3@ 
    is_actor_defined 4@ 
    is_actor_defined 5@ 
    is_actor_defined 6@ 
    is_actor_defined 7@ 
    is_actor_defined 8@    
   then 
           actor.RemoveReferences( 1@ )
           actor.RemoveReferences( 2@ )
           actor.RemoveReferences( 3@ )
           actor.RemoveReferences( 4@ )
           actor.RemoveReferences( 5@ )
           actor.RemoveReferences( 6@ )
           actor.RemoveReferences( 7@ )
           actor.RemoveReferences( 8@ ) 
   end
model.destroy(#VMAFF4)
model.destroy(#VMAFF3)
model.destroy(#VMAFF2)
model.destroy(#VMAFF1) 
model.destroy(#SNIPER)
model.destroy(#CUNTGUN)
model.destroy(#SILENCED)
model.destroy(#TEC9)
model.destroy(#ak47)
model.destroy(#DESERT_EAGLE)
model.destroy(#MP5LNG)
model.destroy(#M4)
model.destroy(#CHROMEGUN)
model.destroy(#SAWNOFF)
model.destroy(#COLT45)
model.destroy(#MICRO_UZI)
model.destroy(#SHOTGSPA)   
04EF: release_animation "gangs"   
terminate_this_custom_script